package org.zsl.controller.springmvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.zsl.model.ResponseMessage;
import org.zsl.model.User;
import org.zsl.service.UserService3;

import java.util.List;

@RestController
@RequestMapping("/mybatis")
public class MybatisController {
    @Autowired
   private UserService3 userService3;

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public List<User> getList(){

        return  userService3.getList();
    }


    @RequestMapping("/register")
    public ResponseMessage register(User user){

        return  userService3.register(user);
    }


}
